﻿namespace WPFBPMN.Utils
{
    using System;
    using System.Windows;
    using CustomControls;

    public class BPMNValue
    {
        DependencyProperty property = null;
        BPMNShape shape;
        public string Name
        {
            get
            {
                return property.Name;
            }
        }
        public string Value
        {
            get
            {
                return shape.GetValue(property).ToString();
            }
            set
            {
                try
                {

                    shape.SetValue(property, Convert.ChangeType(value, property.PropertyType));
                }
                catch (Exception exc)
                {
                    BPMNException exception = new BPMNException(exc, exc.Message);
                }
            }
        }
        public BPMNValue(BPMNShape shape, DependencyProperty property)
        {
            this.shape = shape;
            this.property = property;
        }
    }
}